
#include <typeinfo>
#include <exception>
#include <cstdlib>
#include <cstring>

using namespace std;

type_info::~type_info()
{}
int type_info::operator==(const type_info& rhs) const 
{ 
	return strcmp(_m_d_name, rhs._m_d_name) == 0;
}
int type_info::operator!=(const type_info& rhs) const 
{ 
	return strcmp(_m_d_name, rhs._m_d_name) != 0; 
}
int type_info::before(const type_info& rhs) const 
{ 
	return strcmp(_m_d_name, rhs._m_d_name);
}
const char* type_info::name() const 
{ 
	return _m_d_name; 
}
const char* type_info::raw_name() const 
{ 
	return _m_d_name; 
}

//Nie wprowadzam implementacji bo STL_PORT i tak ma wlasna

exception::exception()
   : _m_what( 0 )
   , _m_doFree( 0 )
{}

exception::exception(exception const &) throw()
 : _m_what( 0 )
 , _m_doFree( 0 )
{
	//const_cast<exception &>(other)._m_doFree = 0;
}
exception::exception(const char*) throw()
 : _m_what( 0 )
 , _m_doFree( 0 )
{
}
exception & exception::operator= (const exception&) throw()
{
	return *this;
}
exception::~exception() throw()
{}
const char* exception::what() const throw()
{ 
	return _m_what; 
}

/*
class _CRTIMP bad_exception : public exception {
public:
    bad_exception(const char* w = "bad exception") throw() : exception(w) {
    }
    virtual ~bad_exception() throw() {
    }
};

typedef void (*unexpected_handler)();
unexpected_handler set_unexpected(unexpected_handler);
void unexpected();

typedef void (*terminate_handler)();
terminate_handler set_terminate(terminate_handler);
void terminate();

bool uncaught_exception();
*/

void __cdecl __ehvec_ctor(void * __t, unsigned int __s , int __n, void (__cdecl*__f)(void *), void (__cdecl* __d)(void *))
{
    while (-- __n >= 0) {
        (*__f) (__t);
        __t = (char *) __t + __s;
	}
}

/*
inline void __stdcall __vec_dtor (
    void *__t,
    unsigned __s,
    int __n,
    void (__thiscall *__f) (void *))

{
    __t = (char *) __t + __s * __n;
    while (-- __n >= 0) {
        __t = (char *) __t - __s;
        (*__f) (__t);
    }
}
*/
//eh vector destructor iterator(pA,sizeof(A),count,&A::~A);
void __cdecl __ehvec_dtor(void * pA,unsigned int __Asize, int __n,void (__cdecl*__dtor)(void *))
{
	try {
    pA = (char *) pA + __Asize * __n;
    while (-- __n >= 0) {
        pA = (char *) pA - __Asize;
        (*__dtor) (pA);
    }
	} catch(...)
	{
		//uncaught_exception();
	}
}